Flash memory devices typically are electrically erasable and/or programmable and are often used for data storage in relatively large units. Flash memory is widely used, for example, for storage of operating system and other computer programs for computers and computer-controlled devices, and for storage of video, audio and/or other media files for consumer devices, such as digital cameras and music players.
FIG. 1 illustrates a conventional use of flash memory. A CPU 11 and random access memory (RAM) 14 communicate over a bus 15, which may include data and control signal lines. The RAM 14 may be used to temporarily store program code, such as operating system and applications programs, and data upon which the CPU 11 operates. A flash memory controller 12 is also coupled to the bus 15, and controls data transfer between the bus 15 and a flash memory 13, which may be used for non-volatile storage of information used by the CPU 11 and RAM 14. For example, in some applications, a boot program may be stored in the flash memory 13, and the CPU 11 may load the boot program via the flash controller 12. In further applications, data, such as audio and video files, may be transferred between the flash memory 13 and the bus 15 via the flash controller 12.
In some applications, the RAM 14 may be used to support management of a file system for the flash memory 13. Referring to FIG. 2, an application 21 may read and write data through a file system manager 22 that interfaces with a flash memory 24 via flash translation logic (FTL) 23 that converts disk-oriented address information, i.e., sector addresses, to flash address information, e.g., block and page address information. The FTL 24 may be implemented, for example, in a flash controller, such as the flash controller 12 described above with reference to FIG. 1.
A variety of different file systems may be used with flash memory. FIG. 3 illustrates a conventional FAT (file allocation table) file system, including a BIOS Parameter Block BPB region, a FAT table region, a directory entry region, and a data region. Flash translation logic FTL converts sector numbers in the FAT file system to block and page numbers, such that the FAT table, directory entries and data are stored in at particular block and page locations in the flash memory.
FIGS. 4 and 5 illustrate an example of operations that may occur when using FAT file system in a NAND flash memory application. Referring to FIG. 4, information from a sector 6 of a FAT system is mapped by a flash translation layer FTL to block 0, page 2 of a flash memory. Referring to FIG. 5, if data in block 0, page 2 is modified, the sector 6 is remapped to a new page 3 in block 0. In particular, the flash translation layer FTL may search the flash memory for a free page and write the modified data to the free page. The prior page is then marked as invalid until a “garbage collection” process is executed to erase invalid pages so that they may be freed for future writes.
As FAT file systems were originally developed for use with disk drives with different characteristics than flash memory, other types of file systems have been developed that are more tailored to the characteristics of flash memory. Examples of such file systems include JFFS and JFFS2, described in an article “JFFS: The Journalling Flash File System,” by David Woodhouse, presented at the Ottawa Linux Symposium in 2001.